package com.uzai.common.enums;

/**
 * 菜单 跳转链接
 * @author cen
 * @date 2022-7-1 15:30:43
 * @param
 * @return null
 */
public enum WxpubMenuRedirectEnum {

    /**
     * 自动转链
     */
    CMS_CONVERT_INDEX(1,"/#/pages_other/convert/index", "自动转链"),

    /**
     * 搜索页面
     */
    CMS_SEARCH_PAGE(2,"/#/pages_other/search_page/index","搜索页面"),

    /**
     * 个人中心
     */
    CMS_MINE_INDEX(3,"/#/pages/mine/index","个人中心"),

    /**
     * cms首页
     */
    CMS_INDEX_INDEX(4,"/#/pages/index/index","cms首页"),

    /**
     * 订单列表
     */
    CMS_ORDERS_INDEX(5,"/#/pages_other/orders/index","订单列表"),

    /**
     * JD页面
     */
    CMS_JD_INDEX(9,"/#/pages/jd/index","JD页面"),

    /**
     * 唯品会
     */
    CMS_VPH_INDEX(10,"/#/pages_other/search_result/index","唯品会"),

    /**
     * 拼多多
     */
    CMS_PDD_INDEX(11,"/#/pages/pdd/index","拼多多"),



    ;

    private Integer id;
    private String value;
    private String desc;

    WxpubMenuRedirectEnum(Integer id, String value, String desc) {
        this.id = id;
        this.value = value;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static WxpubMenuRedirectEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (WxpubMenuRedirectEnum type: WxpubMenuRedirectEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }

    public static WxpubMenuRedirectEnum getByValue(String value) {
        if (value == null) {
            return null;
        }
        for (WxpubMenuRedirectEnum type: WxpubMenuRedirectEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
}
